<?php

namespace App\Http\Requests\Landscaping;

use Illuminate\Foundation\Http\FormRequest;
use App\Http\Requests\BaseRequest;

class ParkManintenanceRequest extends BaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'vegetation_id' => 'required|integer',
            'period' => 'required',
            'department_id' => 'required|integer',
            'type' => 'required|integer',
            'unit' => 'required',
            'num' => 'required|integer'
        ];
    }

    public function messages() 
    {
        return [
            'vegetation_id.required' => '植被种类id不能为空',
            'vegetation_id.integer' => '植被种类id只能填写数字',
            'period.required' => '植被名称不能为空',
            'department_id.required' => '作业部门id不能为空',
            'department_id.integer' => '作业部门id只能填写数字',
            'type.required' => '作业类别不能为空',
            'type.integer' => '作业类别只能填写数字',
            'unit.required' => '周期单位不能为空',
            'num.required' => '维护周期不能为空',
            'num.integer' => '维护周期只能填写数字',
        ];
    }
}
